package hn.cch.service;

import hn.cch.entity.Product;
import hn.cch.fallback.ProductFallback;
import hn.cch.message.Response;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

//使用feign客户端
@FeignClient(value = "shop-product"
        , fallback = ProductFallback.class
)
public interface ProductService {

    @GetMapping(value = "product/getOne/{id}")
    public Product getOne(@PathVariable Integer id);

    @GetMapping(value = "product/subAny/{id}/{stock}")
    public Response<Product> subAny(@PathVariable Integer id, @PathVariable Integer stock);

}

